package creational.factory;


import com.alibaba.fastjson.JSONObject;
import creational.utils.SystemInfoUtils;
import oshi.SystemInfo;

import java.net.UnknownHostException;
import java.util.Properties;

public class FactoryDemo {

    public static creational.factory.Page page = initConfig();


    public static void main(String[] args) {
        page.useButton();

    }

    public static creational.factory.Page initConfig() {
        String property = System.getProperty("os.name");
        if ("Mac OS X".equals(property)) {
            return new MacPage();
        }
        if ("Windows 10".equals(property)) {
            return new WindowsPage();
        }
        return null;
    }
}
